﻿using UnityEngine;
using System.Collections;
using DG.Tweening;
using evt;

public class BounceButton : MonoBehaviour {
	
	public int Type;
	// Use this for initialization
	void Start () {
		EventTriggerListener.Get (gameObject).onClick = GetRoom;
	}

	private void GetRoom(object data){
		
		if (Type == 1) {
			ServerEventDispather.getInstance ().Add (ServerEvent.SHOW_CREATEROOM_VIEW, null);
		} else if (Type == 0) {
			ServerEventDispather.getInstance ().Add (ServerEvent.SHOW_JOINROOM_VIEW, null);
		} else {
			ServerEventDispather.getInstance ().Add (ServerEvent.ERROR_MSG, "功能暂未开放 尽请期待");
		}
		SoundPlayer.play ("7571");
	}
	
	// Update is called once per frame
	void Update () {
	
	}
}
